import { request } from "@/utils/request";

// 获取游戏列表
export function reqGameList() {
  return request<GameLeftMo[]>({
    url: "/roomManage/game/list",
    method: "get"
  });
}

// 首页-房间总计
export function reqRoomTotal() {
  return request<RoomTotalMo>({
    url: "/roomManage/home/room/total",
    method: "get"
  });
}

// 首页-游戏统计
export function reqGameTotal() {
  return request<GameTotalMo[]>({
    url: "/roomManage/home/game/total",
    method: "get"
  });
}

// 首页-游戏历史
export function reqChatHistory(data: Record<string, any>, cancelToken: any) {
  return request<GameHistoryMo[]>({
    url: "/roomManage/chat/chat_history",
    method: "post",
    data,
    cancelToken
  });
}

// 会话列表
export function reqChatContentList(params: Record<string, any>) {
  return request<{
    List: ChatContentMo[];
    Page: number;
    PageSize: number;
    Total: number;
  }>({
    url: "/roomManage/chat/content_list",
    method: "post",
    params
  });
}

// 客服用户消息历史
export function reqChatKefuList(data: Record<string, any>) {
  return request<{
    List: ChatHistoryMo[];
  }>({
    url: "/roomManage/chat/kefu_history",
    method: "post",
    data
  });
}

// 删除会话
export function reqChatContentDel(data: Record<string, any>) {
  return request({
    url: "/roomManage/chat/chat_del",
    method: "post",
    data
  });
}

// 修改游戏状态
export function reqSwitchStatus(data: Record<string, any>) {
  return request({
    url: "/roomManage/game/setting/switchStatus",
    method: "post",
    data
  });
}

// 开奖历史
export function reqGameHisrory(params: Record<string, any>) {
  return request({
    url: "/roomManage/game/history",
    method: "get",
    params
  });
}

// 开奖历史
export function reqGameTotalDetail(params: Record<string, any>) {
  return request({
    url: "/roomManage/home/game/total/detail",
    method: "get",
    params
  });
}

// 反馈-列表
export function reqFeedbackList(params: Record<string, any>) {
  return request<{
    List: FeedbackMo[];
  }>({
    url: "/roomManage/feedback/list",
    method: "get",
    params
  });
}

// 反馈-创建
export function reqFeedbackAdd(data: Record<string, any>) {
  return request({
    url: "/roomManage/feedback/add",
    method: "post",
    data
  });
}

// 反馈-回复列表
export function reqFeedbackReplyList(params: Record<string, any>) {
  return request<FeedbackMo[]>({
    url: "/roomManage/feedback/reply/list",
    method: "get",
    params
  });
}

// 反馈-回复
export function reqFeedbackReply(data: Record<string, any>) {
  return request({
    url: "/roomManage/feedback/reply",
    method: "post",
    data
  });
}

// 在线用户
export function reqOnlineCount() {
  return request<{
    count: number;
    lastDate: string;
  }>({
    url: "/roomManage/home/online/count",
    method: "get"
  });
}

// 修改密码
export function reqPasswordEdit(data: Record<string, any>) {
  return request({
    url: "/roomManage/loginUser/password/edit",
    method: "post",
    data
  });
}

// 获取谷歌密钥-登录用户(右上角)
export function reqGoogleSecret() {
  return request<{
    IsSetting: number;
    QrCode: string;
    Secret: string;
  }>({
    url: "/roomManage/loginUser/getGoogleSecret",
    method: "get"
  });
}

// 谷歌验证绑定(右上角)
export function reqGoogleSecretBind(data: Record<string, any>) {
  return request({
    url: "/roomManage/loginUser/googleSecret/bind",
    method: "post",
    data
  });
}

// 谷歌验证重置(右上角|子账户列表)
export function reqGoogleSecretReset(data?: Record<string, any>) {
  return request({
    url: "/roomManage/user/reset/googleSecret",
    method: "post",
    data
  });
}
